package com.quanxiaoha.xiaohashu.oss.biz.controller;


import com.quanxiaoha.framework.common.response.Response;
import com.quanxiaoha.xiaohashu.oss.biz.service.FileService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Author: jingyan_liu
 * @CreateTime: 2025-07-20
 * @Description:
 * @Version: 1.0
 */


@RestController
@RequestMapping("/file")
@Slf4j
public class FileController {
	
	@Resource
	private FileService fileService;
	
	@PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
	public Response<?> uploadFile(@RequestPart(value = "file") MultipartFile file) {
		return fileService.uploadFile(file);
	}
	
}
